<template>
  <div>
    <div>我是自定义的组件</div>
    <p>{{message}}</p>
    <button v-on:click="sendMsgToParent">向父组件传值</button>
  </div>


</template>

<script>
    export default {
        name: "custom-z",
        props:['message'],
        methods:{
          sendMsgToParent:function () {
           this.$emit('listenToChildEvent','这条消息来自自组件')
         }
       }
    }
</script>

<style scoped>

</style>
